package com.atguigu.tingshu.album.api;

import com.atguigu.tingshu.album.service.AlbumInfoService;
import com.atguigu.tingshu.common.login.GuiGuLogin;
import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.common.util.AuthContextHolder;
import com.atguigu.tingshu.model.album.AlbumInfo;
import com.atguigu.tingshu.vo.album.AlbumInfoVo;
import com.atguigu.tingshu.vo.album.AlbumStatVo;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Tag(name = "专辑管理")
@RestController
@RequestMapping("/api/album")
@SuppressWarnings({"all"})
public class AlbumInfoApiController {

	@Autowired
	private AlbumInfoService albumInfoService;



	/**
	 * 获取当前用户全部专辑列表
	 * /api/album/albumInfo/findUserAllAlbumList
	 * @return
	 */
	@GetMapping("/albumInfo/findUserAllAlbumList")
	@GuiGuLogin
	public Result<List<AlbumInfo>> findUserAllAlbumList(){
		Long userId = AuthContextHolder.getUserId();
		List<AlbumInfo> albumInfos=	albumInfoService.findUserAllAlbumList(userId);
		return Result.ok(albumInfos);
	}


}

